tool_prefix = ARGUMENTS.get('cross', '')

toolchain = {
	"CC":	tool_prefix +'gcc',
	"CXX":	tool_prefix +'g++',
	"LD":	tool_prefix +'g++',
	"AR":	tool_prefix +'ar',
	"STRIP":tool_prefix +'strip',
}

import os
env = Environment(**toolchain)
env.Append(ENV={'PATH': os.environ['PATH']})

dst = ''
if tool_prefix:
	VariantDir(tool_prefix, '.', duplicate=False)
	dst=tool_prefix+'/'

for src in Glob('*.c'):
	file=str(src)
	if file == 'test_timer.c':
		env.Program(dst+file, LIBS='rt')
	else:
		env.Program(dst+file)

